#include <iostream>
using namespace std;

signed main()
{
    int a,b,c;
    cin>>a>>b>>c;
    string q,w,e;
    if(a>=13)
        q.append(1,a/13>=10?(a/13)-10+'A':(a/13+'0'));
    q.append(1,a%13>=10?(a%13)-10+'A':(a%13+'0'));
    if(b>=13)
        w.append(1,b/13>=10?(b/13)-10+'A':(b/13+'0'));
    w.append(1,b%13>=10?(b%13)-10+'A':(b%13+'0'));
    if(c>=13)
        e.append(1,c/13>=10?(c/13)-10+'A':(c/13+'0'));
    e.append(1,c%13>=10?(c%13)-10+'A':(c%13+'0'));
    cout<<"#";
    if(q.size()<2)    cout<<0;
    cout<<q;
    if(w.size()<2)    cout<<0;
    cout<<w;
    if(e.size()<2)    cout<<0;
    cout<<e;
    return 0;
}
